﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.ServiceModel;

namespace Client
{
    static class Program
    {
        /// <summary>
        /// Der Haupteinstiegspunkt für die Anwendung.
        /// </summary>
        //[STAThread]
        static void Main()
        {


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }


    }

    class receiver : IHostFunctionsCallback
    {
        HostFunctionsClient client = null;

        public void Open()
        {
            InstanceContext context = new InstanceContext(this);
            client = new HostFunctionsClient(context);

            client.connect();
        }

        public void ShowMessage(string message)
        {
            MessageBox.Show(message);
        }
    }

    class sender : IHostFunctionsCallback
    {

        HostFunctionsClient client = null;

        public void Open()
        {
            InstanceContext context = new InstanceContext(this);
            client = new HostFunctionsClient(context);

            client.connect();
        }

        public void send()
        {
            Datalib.ChatMessage cm = new Datalib.ChatMessage();
            cm.Message = "Test";
            cm.Name = "Ralf";
            client.send(cm);
        }

        public void ShowMessage(string message)
        {
            MessageBox.Show(message);
        }   
    }
}
